<template>
  <div>
    <el-table style="width:100%"
              :data="data.list"
              v-loading='loading'>
      <el-table-column label="设备号"
                       align="center">
        <template slot-scope="scope">
          <el-popover placement="top-start"
                      title="设备号"
                      width="270"
                      trigger="hover"
                      :content="scope.row.eq_num">
            <el-button type="text"
                       class="ellipsis"
                       slot="reference">{{scope.row.eq_num}}</el-button>
          </el-popover>
        </template>
      </el-table-column>
      <el-table-column label="用户名称"
                       prop="name"
                       align="center"></el-table-column>
      <el-table-column label="联系电话"
                       prop="phone"
                       width="110"
                       align="center"></el-table-column>
      <el-table-column label="车牌号"
                       width="120"
                       prop="plate"
                       align="center">
      </el-table-column>
      <el-table-column label="投保金额"
                       prop="total_price"
                       align="center"></el-table-column>
      <el-table-column label="总行驶里程"
                       width="120"
                       align="center">
        <template slot-scope="scope">
          <el-button type="text">{{scope.row.km}}</el-button>
        </template>
      </el-table-column>
      <el-table-column label="保单号"
                       align="center"
                       width="100">
        <template slot-scope="scope">
          <el-button class="ellipsis"
                     type="text">{{scope.row.policy_num}}</el-button>
        </template>
      </el-table-column>
      <el-table-column label="绑定设备时间"
                       width="120"
                       align="center">
        <template slot-scope="scope">
          <el-popover placement="top-start"
                      title="绑定设备时间"
                      width="270"
                      trigger="hover"
                      :content="scope.row.create_time">
            <el-button type="text"
                       class="ellipsis"
                       slot="reference">{{scope.row.create_time}}</el-button>
          </el-popover>
        </template>
      </el-table-column>
    </el-table>
    <v-Pagination v-if='data && data.rows'
                  :total='data.rows'
                  @pagination='changeSize' />
  </div>
</template>

<script>
export default {
  props: {
    data: {
      default: (() => [] || {})
    },
    loading: {
      default: false
    }
  },
  methods: {
    changeSize (e) {

      this.$emit('changeSize', e)
    }
  }
}
</script>


